package com.zxjbyte.yiyi.framework.common.enums;

import com.zxjbyte.yiyi.framework.common.core.ObjectArrayFactory;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 性别枚举
 *
 * @Author zhangxingjia
 * @Date 2024/9/9 19:33
 * @Version: 1.0
 */
@Getter
@AllArgsConstructor
public enum GenderEnum implements CommonEnum<Integer>, ObjectArrayFactory {

    // 未知
    UNKNOWN(0),

    // 男
    MAN(1),

    // 女
    WOMAN(2);

    private final Integer code;

    @Override
    public Object[] array() {
        return Arrays.stream(values()).map(GenderEnum::getCode).toArray(Integer[]::new);
    }
}
